<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/vue.js"></script>
    <link rel="stylesheet" href="work.css">
</head>

<body>
    <div id="root">
        <form action="">
            账号：<input type="text" v-model="nm" @blur="name" name="" id="name" placeholder="账号长度2-5"><br>
            密码：<input type="text" v-model="pwd" @blur="pwd1" name="" id="password" placeholder="密码字母和数字集合"><br>
            性别：<input type="radio" value="男" name="name" v-model="sex">男<input type="radio" value="女" name="name"
                v-model="sex">女 <br>
            城市：<select name="" id="" v-model="city">
                <option value="">请选择</option>
                <option value="深渊">深渊</option>
                <option value="上海">上海</option>
                <option value="北京">北京</option>
            </select><br>
            年龄：<input type="text" v-model.number='age' @blur="ages" name="" id="age" placeholder="年龄1-200"><br>
            <button @click="onEnter">添加用户</button>
        </form>
        <br>
        <hr>
        <h1>用户信息</h1>
        <table>
            <thead>
                <tr>
                    <td><input type="checkbox" v-model='all' @change="allfn">
                    <span v-if="all">取消全选</span>
                    <span v-if="!all">点击全选</span>
                    </td>
                    <td>账号</td>
                    <td>密码</td>
                    <td>性别</td>
                    <td>城市</td>
                    <td>年龄</td>
                    <td>删除</td>
                </tr>
            </thead>
            <tbody>
                <tr v-for="(item,index) in todo" :key="index">
                    <td><input type="checkbox" @change="selectfn" v-model="lessons">选择</td>
                    <td>{{item.nm}}</td>
                    <td>{{item.pwd}}</td>
                    <td>{{item.sex}}</td>
                    <td>{{item.city}}</td>
                    <td>{{item.age}}</td>
                    <td @click="del(index)">删除</td>
                </tr>
            </tbody>
        </table>


    </div>



    <script src="work.js"></script>
</body>

</html>